package com.asialjim.wechat.pojo.account;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>ENUM DESCRIPTION <i>[ NAME: WeChatAccountStatus ]</i></h2><strong>
 * <p> 微信公众平台账号状态
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/1/27   &nbsp;&nbsp; JDK 8
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum WeChatAccountStatus {

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 在线
     */
    ONLINE("ONLINE"),

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 下线
     */
    OFFLINE("OFFLINE");

    private final String name;

    public static WeChatAccountStatus nameOf(String name){
        return Arrays.stream(values()).filter(value ->value.getName().equals(name)).findFirst().orElse(OFFLINE);
    }
}
